﻿using Fluent.Logging;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fluent.Light.Elements
{
    public class TextBox : WebElement
    {
        public TextBox(IWebDriver driver, By by)
            : base(driver, by) { }

        public void SetText(string text)
        {
            Log.Information("Set text: {0}", text);

            Clear();
            SendKeys(text);

            Log.Information("Then get the current value is: {0}", this.Value);
        }

        public void AppendText(string appendTxt)
        {
            string text = this.Value + appendTxt;

            this.SetText(text);
        }
    }
}
